<?php class Mod_admin extends CI_Model {
	
	function __construct()
	    {
		parent::__construct();
	    }

            /*connexion*/
            function verifCompteAdmin($login,$mdp) {
		$sql = "SELECT * FROM user WHERE USERNAME = '$login' AND MDP = '$mdp'";
		$Q = $this->db->query($sql);		
		$id = 0;
		if ($Q->num_rows()>0){
			foreach ($Q->result_array() as $row){
				$id = $row['ID_USER'];
			}
		}
		$Q->free_result();
		return $id;
        }
}